<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>美嘉饲料</title>
<link href="<%=basePath%>skin/css/style.css" rel="stylesheet" type="text/css" />
<link href="<%=basePath%>skin/css/validform/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<%=basePath%>skin/js/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="<%=basePath%>skin/js/validform/Validform_v5.3.2_min.js"></script>
<script type="text/javascript" src="<%=basePath%>skin/js/jquery.lSelect.js"></script>
<script type="text/javascript" src="<%=basePath%>skin/js/common.js"></script>
<script language="javascript">
	 $().ready(function() {
		 $("#menu_address").attr("class","select");
		// 地区选择
		$("#areaId").lSelect({
			url: "<%=basePath%>area.shtml"
		});
		
		 //验证
		 var validform = $("#form1").Validform({
			btnSubmit:"#save",
			tiptype:3
		 });
		 validform.addRule([
			{
			    ele:"#consignee",
			    datatype:"*",
			    nullmsg:"请输入收货人！"
			},
			{
			    ele:"#address",
			    datatype:"*",
			    nullmsg:"请输入地址！"
			},
			{
			    ele:"#zipCode",
			    datatype:"p",
			    nullmsg:"请输入邮编！"
			},
			{
			    ele:"#phone",
			    datatype:"*",
			    nullmsg:"请输入联系电话！"
			}
		 ]);
	 });
</script>
</head>

<body>
<div class="nb-smt"></div>
<div id="container" class="wkg">
<c:import url="/layouts/top.jsp" />
<div id="content">
        <c:import url="/layouts/head.jsp" />
        <div id="main">
        	<c:import url="../left.jsp" />
			<div id="myRight">
			<div class="myRightTitle">
				<div class="mrtl">
					添加收货地址
				</div>
				<div class="mrtr">
				</div>
				<div class="clear"></div>
			</div>
			<div class="myRightContent">
			<form id="form1" name="form1" method="post" action="<%=basePath%>member/receiver/update.shtml">
			<input type="hidden" name="id" value="${receiver.id}" />
				<div class="shouhuojuti shouhuoyemian" style="margin-top:10px;margin-left:10px;margin-bottom:20px;background-color:#fff;">
                	<div class="jutiitem">收货人：<input type="text" id="consignee" name="consignee" size="30" class="heduiText" value="${receiver.consignee }"/></div>
                    <div class="jutiitem">地区：   <input type="hidden" id="areaId" name="areaId" value="${receiver.area.id }" treePath="${receiver.area.treePath}"/></div>
                    <div class="jutiitem">地址：　<input type="text" id="address" name="address" size="30" class="heduiText" value="${receiver.address }"/></div>
                    <div class="jutiitem">邮编：　<input type="text" id="zipCode" name="zipCode" size="30" class="heduiText" value="${receiver.zipCode }"/></div>
                    <div class="jutiitem">联系电话：<input type="text" id="phone" name="phone" size="30" class="heduiText" value="${receiver.phone }"/></div>
                    <div class="jutiitem">是否默认：<input type="checkbox" id="isDefault" name="isDefault" value="true" <c:if test="${receiver.isDefault }">checked</c:if>/></div>
                    <div class="jutiitem">
	                    <input type="button" value="确　定" class="btnSub" id="save">
					    <input type="button" value="取　消" class="btnQuit" onclick="location.href='<%=basePath%>member/receiver/list.shtml'" style="background-color:rgb(229,229,229);">
                    </div>
                </div>
            </form>					
			</div>
			</div>
        </div>
        <div class="clear"></div>
    </div>
</div>
<c:import url="/layouts/foot.jsp" />
</body>
</html>
